/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package action.staff;

import static com.opensymphony.xwork2.Action.SUCCESS;
import database.StaffDAO;
import java.util.ArrayList;
import java.util.List;
import model.Staff;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;

/**
 *
 * @author Trang
 */
@Namespace("/Administration/Staff")
public class StaffManagementAction {
    private List<Staff> staffs = new ArrayList<Staff>();
    public StaffDAO staffDAO = new StaffDAO();

    public List<Staff> getStaffs() {
        return staffs;
    }

    public void setStaffs(List<Staff> staffs) {
        this.staffs = staffs;
    }
    
    
    @Action(value = "staff-management", results = {
        @Result(name = "success", location = "/manageStaff/w_administrator.jsp")
    })
    public String StaffManagement()
    {
        System.out.println("Trang");
        staffs = staffDAO.getAllStaff();
        //System.out.println(staffs);     
        return SUCCESS;
    }
    @Action(value="add-staff",
             results = {
                 @Result(name="success", location="/manageStaff/w_addstaff.jsp")
             })
     public String AddStaff()
     {
         return SUCCESS;
     }
}
